#ifndef TILE_H
#define TILE_H

#define EXP_MULTIPLIER 2  //每次合并两个数后，值乘2

class Tile
{
public:
    //初始方块的值为2，每次生成的方块值也是2
    Tile() { value = 2; upgratedThisMove = false; }

    Tile(const Tile& other) { this->value = other.value; }

    Tile(int value) { this->value = value; }

    //如果将return的值设置为10，那么每次生成的新方块的值都是10
    int getValue() { return value; }
    //将棋子升级
    void upgrade() { value *= EXP_MULTIPLIER; }

    void setUpgratedThisMove(bool updated) { this->upgratedThisMove = updated; }
    bool getUpgratedThisMove() const { return this->upgratedThisMove; }

private:
    int value;
    bool upgratedThisMove;
};

#endif // TILE_H
